#include<p18f2550.h>
#include <delays.h>
//#include<xc.h>

void main ()
{
    int a,b;
    TRISB=0;ADCON1=15;

    while(1){
        if(!PORTA) a++;

        while(!PORTAbits.RA0)
        { PORTB=1; Delay10TCYx (100+a);
            PORTB=0; Delay10KTCYx (2);
            if(a>100) a=100;
       
        }
         if(!PORTA) b--;

        while(!PORTAbits.RA1)
        { PORTB=1; Delay10TCYx (100+b);
            PORTB=0; Delay10KTCYx (2);
            if(b>100) b=100;

        }
    }

           
    }


